#include <math.h>
#include "StatFunctions.h"

float StatFunctions_Mean(int arrData[], int arrSize)
{
	float mean = 0;
	int i = 0;
	for(i = 0; i < arrSize ; i++)
	{
		mean += arrData[i];
	}

	mean = mean/((float)arrSize);
	return mean;
}

float StatFunctions_StdDev(int mean, int arrData[], int arrSize)
{
	int i = 0;
	float stdDev = 0;
	for(i = 0; i < arrSize ; i++)
	{
		stdDev += powf((float)(arrData[i] - mean),2);
	}

	stdDev = stdDev/((float)arrSize);
	stdDev = sqrt(stdDev);
	return stdDev;
}
